// 本地设置登录信息
export const setLoginInfoStorageSync = (expireTime, token, reToken, reExpireTime) => {
  uni.setStorageSync('expireTime', expireTime)
  uni.setStorageSync('token', token)
  uni.setStorageSync('reToken', reToken)
  uni.setStorageSync('reExpireTime', reExpireTime)
}

// 获取登录信息
export const getLoginInfoStorageSync = () => {
  return {
    expireTime: uni.getStorageSync('expireTime'),
    token: uni.getStorageSync('token'),
    reToken: uni.getStorageSync('reToken'),
    reExpireTime: uni.getStorageSync('reExpireTime')
  }
}

// 删除登录信息
export const removeLoginInfoStorageSync = () => {
  uni.removeStorageSync('expireTime')
  uni.removeStorageSync('token')
  uni.removeStorageSync('reToken')
  uni.removeStorageSync('reExpireTime')
  // 同时清除用户信息
  removeUserInfoStorageSync()
}

// 本地设置其他信息
export const setStorageSync = (key, value) => {
  uni.setStorageSync(key, value)
}

// 获取其他信息
export const getStorageSync = (key) => {
  return uni.getStorageSync(key)
}

// 删除其他信息
export const removeStorageSync = (key) => {
  uni.removeStorageSync(key)
}

// 存储用户信息
export const setUserInfoStorageSync = (userInfo) => {
  uni.setStorageSync('userInfo', userInfo)
}

// 获取用户信息
export const getUserInfoStorageSync = () => {
  return uni.getStorageSync('userInfo')
}

// 删除用户信息
export const removeUserInfoStorageSync = () => {
  uni.removeStorageSync('userInfo')
}

// 清除所有信息
export const clearStorageSync = () => {
  uni.clearStorageSync()
}
